<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html>
<head>
    <title>SQL预览</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
   <style>

/* .autoImg {
width:750px;
height:400px;
margin:0 auto;
} */

</style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
	<div class="test"></div>
	</body>
</html>
<script id="test" type="text/html">
<div class="table-responsive">
 <table class="table table-bordered table-hover">
		<caption><h3 style="margin-top:10px;"></h3></caption>
		<thead>
			<tr>
{{each form as title i}}
		          <th>{{title}}</th>
 {{/each}}
			</tr>
		</thead>
		<tbody>
{{each rows as row i}}
			<tr>
				{{each row as value v}}
					<td>{{value}}</td>		
 				{{/each}}
			</tr>
 {{/each}}
		</tbody>
	 </table>
</div>
</script>	
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
	<script type="text/javascript">
		$(function(){
			   var dialog = top.dialog.get(window);
			   var data = dialog.data;
		    $.post('getExecScriptFile.html?sql='+data.sql,
					{}, function(result) {
						if (result.success) {
							var test = template('test', result);
							$('.test').html(test);
							$('h3').html(data.scriptName);
							
						} else {
							$.HN.message.alert("数据获取失败", '信息', 'error');
						}
					}, "json");	
		});
	</script>
        

